package com.language.points.multi.thread.num;

/**
 * 多线程 - 待操作的对象类型
 * @author yll
 * @version 1.0.0
 * @date 2024/04/12 13：25
 * @desc 数据类型
 * */
public class Numbers {

    volatile private Integer num;

    public Numbers(Integer num){
        this.num = num;
    }

    public void addNum(Integer num){
        this.num += num;
    }
    public void subNum(Integer num){
        this.num -= num;
    }
    @Override
    public String toString() {
        return "Numbers{" +
                "num=" + num +
                '}';
    }
}
